package com.xsq.wifi.utils;

import android.content.Context;

import com.kaopiz.kprogresshud.KProgressHUD;

/**
 * 编写人：李振德
 * 创建时间：2025/05/07
 */
public class ProgressDialogUtil {
    private static KProgressHUD dialog;

    public static void showProgressDialog(Context context) {
        dialog = KProgressHUD.create(context).setStyle(KProgressHUD.Style.SPIN_INDETERMINATE);
        dialog.setCancellable(false);
        dialog.show();
    }

    public static void showProgressDialogText(Context context,String text) {
        dialog = KProgressHUD.create(context).setStyle(KProgressHUD.Style.SPIN_INDETERMINATE).setLabel(text);
        dialog.setCancellable(false);
        dialog.show();
    }

    public static void dismiss() {
        if (dialog != null && dialog.isShowing()) {
            dialog.dismiss();
            dialog = null;
        }
    }
    public static boolean isShowing() {
        return dialog != null && dialog.isShowing();
    }
}
